﻿#ifndef FINANCEWIDGET_H
#define FINANCEWIDGET_H

#include <QWidget>
#include "userpicker.h"
#include "dingdananddetail.h"
#include "financestandarditemmodel.h"
#include "dingdanservice.h"
#include "userservice.h"
#include "messagepicker.h"

namespace Ui {
class FinanceWidget;
}

class FinanceWidget : public QWidget
{
    Q_OBJECT
public:
    explicit FinanceWidget(QWidget *parent = nullptr);
    ~FinanceWidget();

    void setWidgetType(Dingdan::FinanceWidgetType widgetType);

private slots:
    void on_pushButtonFinanceAllocate_clicked();

    void on_lineEditFinanceValue_textChanged(const QString &arg1);

    void on_pushButtonSubmit_clicked();

    void on_pushButtonClear_clicked();

    void on_pushButtonImport_clicked();

    void dealUserRelationSelected(UserRelation *relation);

private:
    Ui::FinanceWidget *ui;
    FinanceStandardItemModel model;
    DingdanService dingdanService;
    UserService userService;

    UserPicker userPicker;
    MessagePicker messagePicker;

    Dingdan::FinanceWidgetType widgetType;
    UserRelation *relation;

    double preSave;

    QString relatedMessageId;
};

#endif // FINANCEWIDGET_H
